home *** CD-ROM | disk | FTP | other *** search
Wrap
' Configuration routines for host mode. ' ' DO NOT COMPILE THIS FILE BY ITSELF! ' ' This file is a part of the complete HOST.SCR and will not compile ' alone. To recompile the host scripts, select Scripts/Compile from ' the QmodemPro for Windows menu and select HOST.SCR in the "Compile ' script" dialog box. This file will automatically be compiled as ' part of the full script. declare sub GetPrivateProfileString lib "kernel" (section as string, entry as string, default as string, buffer as string, bufsize as integer, filename as string) declare function GetPrivateProfileInt lib "kernel" (section as string, entry as string, default as integer, filename as string) as integer declare sub WritePrivateProfileString lib "kernel" (section as string, entry as string, data as string, filename as string) function GetHostProfileString(entry as string, default as string) as string dim buf as string buf = space(128) call GetPrivateProfileString("Host", entry, default, buf, 128, "qmwin.ini") GetHostProfileString = buf end function function GetHostProfileInt(entry as string, default as integer) as integer GetHostProfileInt = GetPrivateProfileInt("Host", entry, default, "qmwin.ini") end function sub WriteHostProfileString(entry as string, data as string) call WritePrivateProfileString("Host", entry, data, "qmwin.ini") end sub sub WriteHostProfileInt(entry as string, data as integer) call WriteHostProfileString(entry, str(data)) end sub function SetupDialog.id(200) as integer dim d as ModemSetupDialog d = ModemSetup if dialogbox(d) = IDOK then ModemSetup = d call WriteHostProfileString("ModemInit", ModemSetup.init) call WriteHostProfileString("ModemAnswer", ModemSetup.answer) call WriteHostProfileString("ModemBusy", ModemSetup.busy) call WriteHostProfileString("ModemOK", ModemSetup.ok) call WriteHostProfileString("ModemRing", ModemSetup.ring) call WriteHostProfileString("ModemRingCount", ModemSetup.ringcount) call WriteHostProfileInt("ModemFaxAnswer", ModemSetup.faxanswer) call WriteHostProfileInt("ModemFaxAto", ModemSetup.faxato) end if end function sub SetupHost dim d as SetupDialog d = Setup if dialogbox(d) = IDOK then Setup = d if Setup.modeopen then call WriteHostProfileInt("Mode", 0) elseif Setup.modeclosed then call WriteHostProfileInt("Mode", 1) elseif Setup.modecallback then call WriteHostProfileInt("Mode", 2) end if call WriteHostProfileString("MaxTime", Setup.maxtime) call WriteHostProfileString("DosPassword", Setup.dospass) call WriteHostProfileString("ShutdownPassword", Setup.shutdownpass) call WriteHostProfileString("DownloadPath", Setup.dlpath) call WriteHostProfileString("UploadPath", Setup.ulpath) call WriteHostProfileInt("SysopAnyPath", Setup.sysopanypath) end if end sub sub LoadConfig Setup.modeopen = 0 Setup.modeclosed = 0 Setup.modecallback = 0 select case GetHostProfileInt("Mode", 0) case 0 Setup.modeopen = 1 case 1 Setup.modeclosed = 1 case 2 Setup.modecallback = 1 end select Setup.maxtime = str(GetHostProfileInt("MaxTime", 60)) Setup.dospass = GetHostProfileString("DosPassword", "") Setup.shutdownpass = GetHostProfileString("ShutdownPassword", "") Setup.dlpath = GetHostProfileString("DownloadPath", "") Setup.ulpath = GetHostProfileString("UploadPath", "") Setup.sysopanypath = GetHostProfileInt("SysopAnyPath", 0) ModemSetup.init = GetHostProfileString("ModemInit", "ATQ0H0S0=0^M") ModemSetup.answer = GetHostProfileString("ModemAnswer", "ATA^M") ModemSetup.busy = GetHostProfileString("ModemBusy", "ATH1M0^M") ModemSetup.ok = GetHostProfileString("ModemOK", "OK") ModemSetup.ring = GetHostProfileString("ModemRing", "RING") ModemSetup.ringcount = str(GetHostProfileInt("ModemRingCount", 1)) ModemSetup.faxanswer = GetHostProfileInt("ModemFaxAnswer", 0) ModemSetup.faxato = GetHostProfileInt("ModemFaxAto", 0) end sub